package com.wb.system.service.impl;

import com.wb.common.vo.QuestionModelVO;
import com.wb.system.domain.QuestionEntity;
import com.wb.system.mapper.QuestionMapper;
import com.wb.system.service.QuestionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class QuestionServiceImpl implements QuestionService {

    @Resource
    private QuestionMapper questionMapper;

    @Override
    public void updateQuestionById(QuestionEntity questionEntity) {

        questionMapper.updateQuestionById(questionEntity);
    }

    @Override
    public void removeQuestionByIds(List<Long> ids) {
        if (ids != null && ids.size() > 0) {
            for (Long id : ids) {
                questionMapper.removeQuestionById(id);
            }
        }
    }

    @Override
    public void saveQuestion(QuestionEntity questionEntity) {
        questionMapper.saveQuestion(questionEntity);
    }

    @Override
    public QuestionEntity selectById(Long id) {
        return questionMapper.selectById(id);
    }

    @Override
    public List<QuestionEntity> selectQuestionList(QuestionModelVO questionModelVO) {
        return questionMapper.selectQuestionList(questionModelVO);
    }
}
